home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / AIncludes / SonyEqu.a < prev    next >
Encoding:
Text File  |  1989-10-13  |  21.8 KB  |  622 lines  |  [TEXT/MPS ]

  1. ; Version: 2.66
  2. ; Created: Saturday, September 16, 1989 at 6:12:26 PM
  3. ;
  4. ; File: SonyEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1984-1988
  8. ; All Rights Reserved
  9. ;
  10. ;--------------------------------------------------------------------
  11. ;
  12. ; The following information was formerly in "private" files that were
  13. ; not released to the general developer community.
  14. ;
  15. ; The information in this file is not needed for normal application
  16. ; development. These equates and macros were necessary for development
  17. ; of the Macintosh ToolBox and Operating System, and are likely to be
  18. ; dependent on their current implementation. Use of any information
  19. ; in this file is likely to cause your software to fail on future
  20. ; versions of Macintosh system software or hardware.
  21. ;
  22. ; Apple Developer Support will not support any use of the following
  23. ; information.
  24. ;
  25. ; In order to prevent any "accidental" use of this information, it has
  26. ; been disabled using the conditional-assembly variable defined below.
  27. ; If you change this to a non-zero value, you're on your own.
  28. ;--------------------------------------------------------------------
  29.  
  30.  
  31. ; If SonyNonPortable is defined to be non-zero, Then a machine type must be specified!
  32.  
  33.                 IF            (&TYPE('SonyNonPortable') = 'UNDEFINED') THEN
  34. SonyNonPortable   EQU        0
  35.                 ENDIF
  36.  
  37.                 IF            (&TYPE('onMac') = 'UNDEFINED') THEN 
  38. onMac            EQU         1
  39.                 ENDIF
  40.  
  41.                 IF            (&TYPE('onMacPP') = 'UNDEFINED') THEN
  42. onMacPP         EQU         0
  43.                 ENDIF
  44.  
  45.                 IF            (&TYPE('onNuMac') = 'UNDEFINED') THEN
  46. onNuMac         EQU         0
  47.                 ENDIF
  48.  
  49.                 IF            (&TYPE('onMvMac') = 'UNDEFINED') THEN
  50. onMvMac         EQU         0
  51.                 ENDIF
  52.  
  53.                 IF            (&TYPE('onHcMac') = 'UNDEFINED') THEN
  54. onHcMac         EQU         0
  55.                 ENDIF
  56.  
  57. ; Note: supportsDCD means support for pass-thru connector as well.
  58. ; If this is 1, firstDCD and maxDCDcnt equates are needed as well.
  59. ; GetDrive must be adjusted for number of drives, as well!
  60.  
  61.                 IF            onMac THEN
  62. supportsPWM     EQU         1                        ; set to 1 if PWM supported
  63. maxDrvNum        EQU         4
  64. supportsDCD     EQU         1                        ; set to 1 to include DCD code
  65. firstDCD        EQU         3
  66. maxDCDcnt        EQU         2
  67. iwmMode         EQU         $1F
  68.                 ENDIF
  69.  
  70.                 IF            onMacPP THEN
  71. supportsPWM     EQU         1                        ; set to 1 if PWM supported
  72. maxDrvNum        EQU         5
  73. supportsDCD     EQU         1                        ; set to 1 to include DCD code
  74. firstDCD        EQU         4
  75. maxDCDcnt        EQU         2
  76. iwmMode         EQU         $17                     ; changed for Brian Howard to set half speed
  77. ; <?? same as Mac ??>
  78.                 ENDIF
  79.  
  80.                 IF            (&TYPE('onNuMacDCD') = 'UNDEFINED') THEN
  81. onNuMacDCD        EQU         0
  82.                 ENDIF
  83.  
  84.                 IF            onNuMac|onMvMac THEN
  85. supportsPWM     EQU         0                        ; set to 1 if PWM supported
  86.                 IF            onNuMacDCD THEN
  87. maxDrvNum        EQU         4
  88. supportsDCD     EQU         1                        ; set to 1 to include DCD code
  89. firstDCD        EQU         3
  90. maxDCDcnt        EQU         2
  91.                 ELSE
  92. maxDrvNum        EQU         2
  93. supportsDCD     EQU         0                        ; set to 1 to include DCD code
  94.                 ENDIF
  95. iwmMode         EQU         $17
  96.                 ENDIF
  97.  
  98.                 IF            onHcMac THEN
  99. supportsPWM     EQU         0                        ; set to 1 if PWM supported
  100. maxDrvNum        EQU         5
  101. supportsDCD     EQU         1                        ; set to 1 to include DCD code
  102. firstDCD        EQU         4
  103. maxDCDcnt        EQU         2
  104. iwmMode         EQU         $17
  105.                 ENDIF
  106.  
  107.  
  108.                 IF            SonyNonPortable THEN
  109.  
  110.                 IF            (&TYPE('supportsMFM') = 'UNDEFINED') THEN
  111. supportsMFM     EQU         0
  112.                 ENDIF
  113.  
  114. ; SonyVars Data Structure (offsets):
  115. ; (1) Driver local vars.
  116. ; (2) Drive-specific vars.
  117. ; (3) More driver local vars.
  118. ; (4) Direct-connect driver locals.
  119. ;
  120. ; Drive Constants:
  121. ; (1) Floppy drive constants (tuneable).
  122. ; (2) Floppy drive sense/control constants.
  123. ; (3) Floppy drive formatting constants.
  124. ; (4) Direct-connect drive constants.
  125. ;
  126. ; Driver Constants:
  127. ; (1) Driver Control codes.
  128. ;
  129. ; Driver Vectors:
  130. ; (1) Location of disk routine vectors.
  131. ;
  132. ;_______________________________________________________________________
  133.  
  134. ;_______________________________________;
  135. ; ;
  136. ; SonyVars Data Structure (offsets): ;
  137. ;_______________________________________;
  138.  
  139. ;_______________________________________;
  140. ;
  141. ; (1) Driver local vars. ; * = known to be used in a copy-
  142. ; protection scheme.
  143. ; +---------------------+ DiskUnitPtr <-----+
  144. ; | | |
  145. ; | "driver local vars" | |
  146. ; | | EjectWait |
  147. ; +---------------------+ <----+ |
  148. ; | | Track | |
  149. ; | drive1 | DrvLclLth |
  150. ; | | DriveMisc | |
  151. ; +---------------------+ <----+ |
  152. ; | | Track |
  153. ; | drive2 | Sony disk driver
  154. ; | | DriveMisc vars, plus
  155. ; +---------------------+ locals for each
  156. ; | | Track diskette drive
  157. ; | driveX | |
  158. ; | | DriveMisc |
  159. ; +---------------------+ |
  160. ; | | FloppyLclEnd |
  161. ; | "more driver vars" | |
  162. ; | | SonyVarEnd <-----+
  163. ; +---------------------+ <-----+
  164. ; | | Track |
  165. ; | driveN | |
  166. ; | | DriveMisc |
  167. ; +---------------------+
  168. ; | | DCD driver vars
  169. ; | driveN | plus locals for
  170. ; | | each DCD drive
  171. ; +---------------------+ |
  172. ; | | DCDCmd |
  173. ; | DCD driver locals | |
  174. ; | | DiskVarLth <-----+
  175. ; +---------------------+
  176. ;
  177. ;_______________________________________________________________________
  178. ;
  179.  
  180.  
  181.                 IF            supportsMFM THEN
  182. ;_______________________________________;
  183. ;
  184. ;  SWIM MFM register offsets from base
  185. ;_______________________________________;
  186.  
  187.  
  188.  
  189. wData            EQU         $0000                    ;Write a data byte
  190. wMark            EQU         $0200                    ;Write a mark byte
  191. wCRC            EQU         $0400                    ;Write a 2-byte CRC (1 access does both)
  192. wIWMConfig        EQU         wCRC                    ;Set IWM configuration
  193. wParams         EQU         $0600                    ;Set the 16 parameter registers
  194. wPhase            EQU         $0800                    ;Set phase lines states and directions
  195. wSetup            EQU         $0A00                    ;Set the current configuration
  196. wZeroes         EQU         $0C00                    ; Mode reg: 1's clr bits, 0's=don't care
  197. wOnes            EQU         $0E00                    ;Mode reg: 1's set bits, 0's=don't care
  198. rData            EQU         $1000                    ;Read a data byte
  199. rCorrection     EQU         rData                    ;Read the correction factor
  200. rMark            EQU         $1200                    ;Read a mark byte
  201. rError            EQU         $1400                    ;Error register
  202. rParams         EQU         $1600                    ;Parameters (16 bytes deep at this addr)
  203. rPhase            EQU         $1800                    ;Phase lines states and directions
  204. rSetup            EQU         $1A00                    ;Read the current configuration
  205. rStatus         EQU         $1C00                    ;Status (returns current mode reg value)
  206. rHandshake        EQU         $1E00                    ;Handshake register
  207. mfmSectTime     EQU         75                        ;7.5msec sector time
  208. maxMFMSectors    EQU         18                        ;18 MFM sectors/track side (@1440K)
  209.                 ENDIF
  210.  
  211. maxGCRSectors    EQU         12                        ;12 GCR sectors/track side (max)
  212. diskUnitPtr     EQU         0                        ; pointer to device control entry
  213. diskQVE         EQU         diskUnitPtr+4            ; disk VBL task control block
  214. drive            EQU         diskQVE+14                ; * 0001 = int drive, 0002 = ext drive
  215. wait            EQU         drive+2                 ; extra wait time for speed changes
  216. sideTrack        EQU         wait+2                    ; destination side/track
  217. oneToOne        EQU         sideTrack+2             ; open up rupts flg (no longer used)
  218. active            EQU         oneToOne+1                ; * non-zero when driver is active
  219. timeOut         EQU         active+1                ; * power time out
  220. diskBuffer        EQU         timeOut+2                ; pointer to track data buffer
  221. firstSect        EQU         diskBuffer+4            ; low sector number needed on a track
  222. sectMap         EQU         firstSect+2             ; bit map of sectors needed on a track
  223. firstFSeq        EQU         sectMap+4                ; first file seq # for current r/w request
  224. fBlksDone        EQU         firstFSeq+2             ; file blocks done previous to this track
  225. readErrInit     EQU         fBlksDone+2             ; init value, read error countdown cntr
  226. readErrCnt        EQU         readErrInit+1            ; read error countdown cntr
  227. recalInit        EQU         readErrCnt+1            ; init value, recal count
  228. recalCnt        EQU         recalInit+1             ; recal count
  229. wrgSectInit     EQU         recalCnt+1                ; init value, wrong sector countdown cnt
  230. wrgSectCnt        EQU         wrgSectInit+1            ; wrong sector countdown cnt
  231. badSpdInit        EQU         wrgSectCnt+1            ; init value, bad speed
  232. badSpdCnt        EQU         badSpdInit+1            ; bad speed countdown value
  233. command         EQU         badSpdCnt+1             ; I/O command
  234. headSettle        EQU         command+2                ; disk head settle time (@100usec)
  235. spdChgTime        EQU         headSettle+2            ; motor speed change time (@100usec)
  236. pwrOnTime        EQU         spdChgTime+2            ; * power-on wait time (@100usec)
  237. pwrOffTime        EQU         pwrOnTime+2             ; * power down time (@1/2sec)
  238. seekTime        EQU         pwrOffTime+2            ; seek wait time (@100usec)
  239. sectTime        EQU         seekTime+2                ; * sector time (@100usec)
  240. dskVBLTime        EQU         sectTime+2                ; VBL task time (@16ms)
  241. ejectTime        EQU         dskVBLTime+2            ; Eject time (@100usec)
  242. ckDelta         EQU         ejectTime+2             ; delta time before speed recheck
  243. ejectWait        EQU         ckDelta+4                ; VBL times after eject to ignore DIP
  244.  
  245. ; Format/Verify code reuses some of these fields as follows:
  246.  
  247. gapSync         EQU         sectMap                 ; (2) start with 7 groups of intersector sync
  248. twoSided        EQU         command                 ; (1) set non-zero for 2-sided format
  249. sectSave        EQU         firstSect                ; (2) SectMpSave must follow
  250. sectMapSave     EQU         sectMap                 ; (8) uses SectMap, FirstFSeq, FBlksDone
  251. sectCnt         EQU         firstSect                ; (2) loop counter . . .
  252.  
  253. ;_______________________________________;
  254. ;
  255. ; (2) Drive-specific vars.
  256.  
  257. drvLclLth        EQU         66
  258. drive1            EQU         ejectWait+2             ; * internal drive variables
  259. drive2            EQU         drive1+drvLclLth        ; * external drive variables
  260.  
  261.                 IF            onMac|onNuMac|onMvMac THEN
  262. floppyLclEnd    EQU         drive2+drvLclLth
  263.                 ENDIF
  264.  
  265.                 IF            onMacPP | onHcMac THEN
  266. drive3            EQU         drive2+drvLclLth        ; * real external for MacPP
  267. floppyLclEnd    EQU         drive3+drvLclLth
  268.                 ENDIF
  269.  
  270. track            EQU         0                        ; current track location (used for spd)
  271. writeProt        EQU         2                        ; * bit7=1=write-protected
  272. diskInPlace     EQU         3                        ; * $FC-$FF= just ejected,
  273. ; 0=no disk in place,1=DIP,2=clamped
  274. installed        EQU         4                        ; * 0=don't know, 1=inst., $FF=not inst.
  275. sides            EQU         5                        ; * bit7=0=1 sided
  276. dqel            EQU         6                        ; drive queue element for this drive
  277. driveQLink        EQU         6
  278. driveQVers        EQU         10
  279. driveSize        EQU         18                        ; drive block size (DCD only!)
  280. twoSideFmt        EQU         18                        ; * non-zero if 2-sided format
  281. newIntf         EQU         19                        ; $FF if new interface, $00 for old 
  282. driveErrs        EQU         20                        ; drive soft errs
  283. driveS1         EQU         20                        ; drive block size (high word)
  284. driveType        EQU         22                        ; old OffSpeed (no longer supported)
  285. driveManf        EQU         24
  286. driveChar        EQU         26
  287.  
  288.                 IF            supportsMFM THEN
  289. mfmDrive        EQU         22                        ;$FF=SuperDrive, $00=400K or 800K GCR
  290. mfmDisk         EQU         23                        ;$FF=MFM, $00=GCR or unformatted
  291. twoMegFmt        EQU         24                        ;$FF=2 meg MFM (1440K), $00=1 meg (720K)
  292.                 ENDIF
  293.  
  294. driveMisc        EQU         27
  295. spdAdjCnt        EQU         24                        ; speed adjust count this drive
  296. trkSpeedTbl     EQU         26                        ; 5-entry track speed table
  297. tSTblCode        EQU         0                        ; first is speed code
  298. tSTblDelta        EQU         2                        ; 2% speed code delta
  299. tSTblTicks        EQU         4                        ; longword last time checked tick cnt
  300. trkSTEnd        EQU         66                        ; end of drive vars
  301.  
  302. ;_______________________________________;
  303. ;
  304. ; (3) More driver local vars.
  305.  
  306. wakeTimeCnt     EQU         floppyLclEnd            ; WakeUp remainder count
  307. saveRegs        EQU         wakeTimeCnt+2            ; * wakeup routine saves D3-D7,A3-A6 here
  308. tagBufPtr        EQU         saveRegs+36             ; if non-zero, pointer to separate
  309.                                                         ; buffer for file tags . . .
  310. tagBufOS        EQU         tagBufPtr+4             ; temp offset into buffer
  311. diskErrs        EQU         tagBufOS+2                ; global soft errors
  312. passThru        EQU         diskErrs+2                ; 0 if pass thru on external port
  313.                 IF            supportsMFM THEN
  314. hasSuperDrives    EQU         passThru+1                ; $FF if at least 1 SuperDrive connected
  315. curSector        EQU         hasSuperDrives+1        ; current sector being read/written 
  316.                 ELSE
  317. sonyExtra        EQU         passThru+1                ; extra byte
  318. curSector        EQU         sonyExtra+1             ; current sector being read/written 
  319.                 ENDIF
  320.  
  321. tcRdEnable        EQU         curSector+2             ; (byte) set non-zero to activate reads into cache
  322. tcInstalled     EQU         tcRdEnable+1            ; (byte) non-zero when caching is installed and on
  323. tcDrive         EQU         tcInstalled+1            ; (word) drive number of cache blks (zero to inval)
  324. tcSideTrack     EQU         tcDrive+2                ; (word) side/track of cache blocks 
  325. tcSectMap        EQU         tcSideTrack+2            ; (long) bitmap of sectors currently cached 
  326. tcBuffer        EQU         tcSectMap+4             ; (long) pointer to track cache buffer (512+12)*12
  327. tcNumCached     EQU         tcBuffer+4                ; (word) number read into cache 
  328. tcNumUsed        EQU         tcNumCached+2            ; (word actual number used
  329. lastDrive        EQU         tcNumUsed+2             ; (word) set at CkDrvNum to previous value of Drive
  330. timeOutDrive    EQU         lastDrive+4             ; (word) set at PowerDown to value of Drive 
  331. ; Above value should have been +2 since lastDrive is a word.
  332. timeQEl         EQU         timeOutDrive+2            ; a time queue element
  333.  
  334.                 IF            onMac THEN
  335. nextGZProc        EQU         timeQEl+tmQSize-2        ; (long) saved old GZ proc
  336. ; Above had been +tmQSize, but that changed from $C to $E.
  337. sonyVarEnd        SET         nextGZProc+4            ; end of sony vars excluding DCD
  338.                 ELSE
  339. nextGZProc        EQU         timeQEl+tmQSize         ; (long) saved old GZ proc
  340. driveXlat        EQU         nextGZProc + 4            ; drive translate table (GetDrive,DiskOpen)
  341. drvTblPtr        EQU         driveXlat+((maxDrvNum+1)*2) 
  342.                                                         ; (long) pointer to DrvTbl to use
  343. sonyVarEnd        SET         drvTblPtr+4
  344.                 ENDIF
  345.  
  346.                 IF            supportsMFM THEN
  347. isSWIM            EQU         sonyVarEnd                ;FDC type: $FF=SWIM, $00=IWM
  348. mfmMode         EQU         isSWIM+1                ;Current register set selected: $FF=SWIM, $00=IWM
  349. sonyVarEnd        SET         mfmMode+1                ; end of sony vars excluding DCD
  350.                 ENDIF
  351.  
  352.                 IF            onHcMac THEN
  353. chipState        EQU         sonyVarEnd                ; Byte holds flag to indicate IWM on or off
  354. sonyVarEnd        SET         chipState+2             ; end of sony vars excluding DCD
  355.                 ENDIF
  356.  
  357.  
  358.                 IF            onMac|onNuMacDCD THEN
  359. ;_______________________________________;
  360. ;
  361. ; (4) Direct-connect driver locals.
  362.  
  363. tagSize         EQU         20                        ; 20 bytes tags/block
  364. dcdLclLth        EQU         28                        ; (use fields through DriveMisc)
  365. drive3            EQU         sonyVarEnd                ; first DCD 
  366. drive4            EQU         drive3+dcdLclLth        ; second DCD
  367. drive5            EQU         drive4+dcdLclLth        ; third DCD
  368. drive6            EQU         drive5+dcdLclLth        ; fourth DCD
  369.  
  370.                 ENDIF
  371.  
  372.                 IF            onMacPP|onHcMac THEN
  373. ;_______________________________________;
  374. ;
  375. ; (4) Direct-connect driver locals.
  376.  
  377. tagSize         EQU         20                        ; 20 bytes tags/block
  378. dcdLclLth        EQU         28                        ; (use fields through DriveMisc)
  379. drive4            EQU         sonyVarEnd                ; first DCD
  380. drive5            EQU         drive4+dcdLclLth        ; second DCD
  381. drive6            EQU         drive5+dcdLclLth        ; third DCD
  382.                 ENDIF
  383.  
  384.                 IF            onMac|onMacPP|onHcMac|onNuMacDCD THEN
  385.  
  386.  
  387. stsRtnAddr        EQU         drive6+dcdLclLth        ; DCD status call return address
  388. dcdCmd            EQU         stsRtnAddr+4            ; command byte to DCD
  389. response        EQU         dcdCmd                    ; response byte (command+$80)
  390. seqNum            EQU         response+1                ; mb sequence number (sys commands only)
  391. status            EQU         seqNum+1                ; returned status bytes
  392. startBlock        EQU         status                    ; starting block # (in commands)
  393. driveOut        EQU         startBlock+3            ; we send drive number in this field
  394. driveIn         EQU         status+2                ; low 6 bits
  395. tagBytes        EQU         status+4                ; tag bytes get stuffed here temporarily
  396. devType         EQU         tagBytes                ; first 20 bytes of status are written
  397. devManufctr     EQU         devType+2                ; in the 20-byte tag buffer
  398. devChar         EQU         devManufctr+2
  399. devBlks         EQU         devChar                 ; low 3 bytes of this longword
  400. devSpares        EQU         devChar+4
  401. devBadBlks        EQU         devSpares+2
  402. devMisc         EQU         devBadBlks+2            ; 8 bytes misc
  403. bufSize         EQU         tagBytes+tagSize        ; number of bytes/block
  404. lastStatus        EQU         bufSize+4                ; last status returned
  405. lastResult        EQU         lastStatus+4            ; error type
  406. dcdFlags        EQU         lastResult+1            ; flag of whether we've done a reset
  407. chkTime         EQU         dcdFlags+1                ; 100usec check ready count
  408. maxTime         EQU         chkTime+2                ; maximum number of checks
  409. stsBuffer        EQU         maxTime+2                ; 512 bytes of status
  410. devReserve        EQU         stsBuffer
  411. devIcon         EQU         devReserve+44
  412. devFiller        EQU         devIcon+256             ; 32 bytes for optional name
  413. diskVarLth        EQU         devFiller+32
  414. stsBufSize        EQU         diskVarLth-stsBuffer
  415.  
  416.                 ELSE                                ;
  417. diskVarLth        EQU         sonyVarEnd                ;
  418.                 ENDIF                                ;
  419.  
  420. ; device characteristics byte:
  421.  
  422. devChEject        EQU         4                        ; ejectable if 1
  423. devChWP         EQU         3                        ; write protected if 1
  424. devChIcon        EQU         2                        ; icon available if 1
  425.  
  426.  
  427. ;_______________________________________;
  428. ; ;
  429. ; Drive Constants: ;
  430. ;_______________________________________;
  431.  
  432.  
  433. dqSides         EQU         -1                        ; Bit 7 of this byte: 0=single-sided Sony, 1=double sided
  434. dqInstall        EQU         -2                        ; 0=unknown, 1=installed, FF=no disk
  435. dqDIP            EQU         -3                        ; $FC-$FF = disk just ejected,
  436. ; 0 = no disk in place
  437. ; 1 = disk in place
  438. ; 2 = disk has been read
  439. ; >8 = non-ejectable disk
  440. dqWrPrt         EQU         -4                        ; Bit 7 of this byte: 1=disk is write protected.
  441.  
  442. ;_______________________________________;
  443. ;
  444. ; (1) Floppy drive constants (tuneable).
  445.  
  446. kSeekTime        EQU         120                     ; 12 ms trk-to-trk
  447. kHdSetTime        EQU         300                     ; 30 ms head settle time
  448. kEjectTime        EQU         7500                    ; .75 seconds eject time
  449. kEjectWait        EQU         -4                        ; - number of VBL calls after eject before dip check
  450. kSectTime        EQU         100                     ; minimum sector time in 100 us increments (10 ms)
  451. kPowerOn        EQU         4000                    ; read/write powerup time in 100 us increments
  452. kRWPOff         EQU         5                        ; read/write power off time (in 1/2 seconds)
  453. kDskVBLTime     EQU         30                        ; happens every 1/2 second
  454. kSpdChgTime     EQU         1500                    ; speed change wait time = 150ms
  455. kCkDelta        EQU         14400                    ; speed check delta time (in 1/60 sec) (4 min)
  456.  
  457. ;_______________________________________;
  458. ;
  459. ; (2) Floppy drive sense/control constants.
  460. ; (ca1-ca0-sel-ca2).
  461.  
  462. dirLAdr         EQU         0                        ; dirtn low
  463. dirHAdr         EQU         1
  464. rdDtaAdr        EQU         1                        ; side 0 read data
  465. rdDta1Adr        EQU         3                        ; side 1 read data
  466. stepLAdr        EQU         4                        ; step low and step sense address
  467. stepHAdr        EQU         5
  468.                 IF            supportsMFM THEN
  469. mfmModeAdr        EQU         6                        ;Switch drive into MFM (constant) mode
  470. gcrModeAdr        EQU         7                        ;Switch drive into GCR (variable) mode
  471.                 ENDIF
  472. mtrOnAdr        EQU         8
  473. mtrOffAdr        EQU         9
  474. ejectLAdr        EQU         12
  475. ejectHAdr        EQU         13
  476. dipAdr            EQU         2                        ; disk in place sense address
  477. mfmDrvAdr        EQU         5                        ;1=SuperDrive, 0=400K or 800K GCR
  478. wrProtAdr        EQU         6                        ; write protect sense address
  479. sidesAdr        EQU         9                        ; sense for number of sides
  480. tk0Adr            EQU         10                        ; track 0 sense address
  481. readyAdr        EQU         11                        ; /Ready sense address
  482. drvExstAdr        EQU         13                        ; sense=0 when a drive is connected
  483. tachAdr         EQU         14                        ; tach feedback sense address
  484. newIntfAdr        EQU         15                        ; implements ready handshake if 1
  485.                 IF            supportsMFM THEN
  486. twoMegAdr        EQU         15                        ;0=1 meg disk, 1=2 meg disk
  487.                 ENDIF
  488.  
  489. ;_______________________________________;
  490. ;
  491. ; (3) Floppy drive formatting constants.
  492.  
  493. fmtByte         EQU         $02                     ; 2-1 interleave, single-sided
  494. fmt2Byte        EQU         $22                     ; 2-1 interleave, double-sided
  495. mustFindCt        EQU         1500
  496. minSync         EQU         4                        ; min number of inter-sector sync groups
  497.                 IF            supportsMFM THEN
  498.  
  499. numSDFmts        EQU         3                        ; 2 GCR + 1 MFM single-density
  500. numDDFmts        EQU         1                        ; 1 MFM double-density format
  501.                 ELSE
  502. numSDFmts        EQU         2                        ; 2 GCR single density formats
  503.                 ENDIF
  504.  
  505.                 IF            onMac|onMacPP|onHcMac|onNuMacDCD THEN
  506. ;_______________________________________;
  507. ;
  508. ; (4) Direct-connect drive constants.
  509.  
  510. blkSize         EQU         512                     ; 512 bytes data/block
  511. syncByte        EQU         $AA                     ; Sync byte for start of transmission
  512. nonZerStat        EQU         1
  513. comErr            EQU         2
  514.  
  515. ; New HD20 error codes
  516.  
  517. wrtHsLw         EQU         $10                     ; HSHK low before starting
  518. wrtHSLwTO        EQU         $11                     ; Time out waiting for HSHK to go low
  519. wrtHSHighTO     EQU         $13                     ; Time out waiting for HSHK to go high
  520. rdHsHi            EQU         $20                     ; HSHK high before starting
  521. rdSyncTO        EQU         $21                     ; Time out waiting for sync ($AA) bye
  522. rdGroupTO        EQU         $22                     ; Time out waiting for group
  523. rdHoffSyncTO    EQU         $24                     ; Time out waiting for sync after holdoff
  524. rdHsHiTO        EQU         $25                     ; Time out waiting for HSHK high
  525. rdChksumErr     EQU         $26                     ; Checksum error on response packet
  526. invalidResp     EQU         $30                     ; First byte in response packet was wrong
  527. sqncNumErr        EQU         $31                     ; Sequence number in response packet was wrong
  528. dNumberErr        EQU         $32                     ; Drive number in response packet was wrong
  529. noResp            EQU         $40                     ; No response packet ever received
  530.  
  531. ; LastStatus
  532.  
  533. opFailed        EQU         24                        ; bit to test for operation failed
  534. bChksum         EQU         30                        ; bit number for checksum error
  535.  
  536. ; DCDFlags
  537.  
  538. resetonce        EQU         0
  539. retryonce        EQU         1
  540. maxTries        EQU         4                        ; max # times to try command
  541. tSeekChk        EQU         10                        ; check during a seek every 1 ms
  542. tSeekMax        EQU         10000                    ; max time for seek = 10 secs
  543. tStsChk         EQU         10                        ; check during a status every 1 ms
  544. tStsMax         EQU         10000                    ; max time for status = 10 secs
  545. tQuickTime        EQU         100
  546. tNextChk        EQU         7                        ; check for next block after 700 µsec
  547. tNextMax        EQU         10000                    ; max time for next block = 7 secs
  548. tFVChk            EQU         100                     ; check during fmt/vfy every 10 ms
  549. tFVMax            EQU         18000                    ; max time for fmt/vfy = 3 minutes
  550. tRstAssert        EQU         1000                    ; assert reset for 100 msec
  551. tRstSettle        EQU         20000                    ; 2 sec wait for busy to settle
  552. tRstChk         EQU         100                     ; check during reset every 10 ms
  553. tRstMax         EQU         1600                    ; max time for reset = 16 seconds
  554.  
  555. ; DCD sense/cntl addr (ca1-ca0-sel-ca2)
  556.  
  557. dcdExist        EQU         5                        ; /Exist (/Sides=/DrvIn=1 also)
  558. dcdReset        EQU         1                        ; for 1ms resets DCD controller
  559.                 ENDIF                                ;
  560.  
  561. ;_______________________________________;
  562. ; ;
  563. ; Driver Constants: ;
  564. ;_______________________________________;
  565.  
  566. ;_______________________________________;
  567. ;
  568. ; (1) Driver Control codes.
  569.  
  570. verifyCC        EQU         5                        ; 'verify' control code
  571. formatCC        EQU         6                        ; 'format' control code
  572. tagBufCC        EQU         8                        ; 'set tag buffer' control code
  573. tCacheCC        EQU         9                        ; 'track cache' control 
  574. iconIDCC        EQU         20                        ; 'get icon id' control code
  575. iconCC            EQU         21                        ; 'get icon' control code
  576. iconLogCC        EQU         22                        ; 'get logical icon' code
  577. infoCC            EQU         23                        ; 'get drive info' code
  578.  
  579. ; (2) Driver Status codes.
  580.  
  581. fmtLstCode        EQU         6                        ;Returns a list of disk formats
  582.                 IF            supportsMFM THEN
  583. mfmStsCode        EQU         10                        ;'Get MFM status' status code
  584.                 ENDIF
  585.  
  586.  
  587. ;_______________________________________;
  588. ;
  589. ; Driver Vectors: ;
  590. ;_______________________________________;
  591.  
  592. ;_______________________________________;
  593. ;
  594. ; (1) Location of disk routine vectors.
  595.  
  596. JFigTrkSpd        EQU         DiskVars
  597. JDiskPrime        EQU         JFigTrkSpd+4
  598. JRdAddr         EQU         JDiskPrime+4
  599. JRdData         EQU         JRdAddr+4
  600. JWrData         EQU         JRdData+4
  601. JSeek            EQU         JWrData+4
  602. JSetUpPoll        EQU         JSeek+4
  603. JRecal            EQU         JSetUpPoll+4
  604. JControl        EQU         JRecal+4
  605. JWakeUp         EQU         JControl+4
  606. JReSeek         EQU         JWakeUp+4
  607. JMakeSpdTbl     EQU         JReSeek+4
  608. JAdrDisk        EQU         JMakeSpdTbl+4
  609. JSetSpeed        EQU         JAdrDisk+4
  610. NiblTbl         EQU         JSetSpeed+4
  611. JDiskSel        EQU         $B40                    ; (long) vector to .Sony DiskSelect routine 
  612. JSendCmd        EQU         $B44                    ; (long) vector to .Sony DCD SendCmd routine
  613. JDCDReset        EQU         $B48                    ; (long) vector to .Sony DCD DCDReset routine
  614.  
  615.                 IF            supportsMFM THEN
  616. JMRdAddr        EQU         $680                    ; (long) vector to MFM MRdAddr
  617. JMRdData        EQU         JMRdAddr+4                ; (long) vector to MFM MRdData
  618. JMWrData        EQU         JMRdData+4                ; (long) vector to MFM MWrData
  619.                 ENDIF
  620.  
  621.                 ENDIF                                ;end exclusion of private information
  622.